home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / TinyGL / ami / content / ad709 / tinygl / src / ztriangle.h < prev   
Encoding:
C/C++ Source or Header  |  2002-08-15  |  1.3 KB  |  33 lines

  1. #ifndef _ztriangle_h
  2. #define _ztriangle_h
  3.  
  4. #include <stdlib.h>
  5. #include <stdio.h>
  6. #include "zbuffer.h"
  7.  
  8.  
  9. #define ZCMP(z, zpix)            ((z) >= (zpix))
  10. #define SAR_RND_TO_ZERO(v, n)    (v / (1 << n))
  11. #define NB_INTERP    8
  12.  
  13.  
  14. typedef void (*draw_init_t) (int *_drgbdx, int drdx, int dgdx, int dbdx, int *color, ZBufferPoint *p2,
  15.                              float    *fdzdx, float *fndzdx, float *ndszdx, float *ndtzdx, PIXEL *texture,
  16.                              float *dszdx, float *dtzdx, ZBuffer *zb, int dzdx);
  17.  
  18. typedef void (*put_pixel_t) (int _a, int *zz, PIXEL *pp, int *tmp, int *rgb, int drgbdx, int *z, 
  19.                              unsigned short *pz, int dzdx, int color, PIXEL *texture, 
  20.                              unsigned int *s, unsigned int *t, int dsdx, int dtdx);
  21.  
  22. typedef void (*draw_line_t) (int dzdx, int _drgbdx, int r1, int g1, int b1, unsigned short *pz1, 
  23.                              PIXEL *pp1, int x1, int x2, int z1, float sz1, float tz1, float dszdx, float dtzdx, 
  24.                              float fdzdx, float fndzdx, float ndszdx, float ndtzdx, PIXEL *texture);
  25.  
  26. void renderTriangle(ZBuffer *zb, ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint *p2, int color, int _drgbdx,
  27.                     PIXEL    *texture, float    fdzdx, float fndzdx, float ndszdx, float ndtzdx,
  28.            char interp_z_d, char interp_rgb_d, char interp_st_d, char interp_stz_d,
  29.            draw_init_t _draw_init, put_pixel_t _put_pixel, draw_line_t _draw_line);
  30.  
  31.  
  32. #endif
  33.